package server;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;

import constants.Log;

public class InputMasterServer extends Thread{
	private BufferedReader br;
	private Server s;
	private boolean running;
	private Log l;
	public InputMasterServer(BufferedReader br,Server s, Log l){
		this.br=br;
		this.s=s;
		this.l = l;
	}
	public void run() {
		running=true;
		while(running){
			String fromClient=null;
	        try {
				while ((fromClient = br.readLine()) != null) {
					Log.write(fromClient);
					s.newInput(fromClient);
				}
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
	public void stopMe(){
		running=false;
	}

}
